import { App } from "vue";
import { useUserStore } from "@/store/userStore";
export function DirectivePermission(app: App<Element>) {
  const userStore = useUserStore();
  app.directive('permission', {
    mounted(el, bind) {
      // 判断 pinia里面是否有对应的权限
      let has = userStore.permissions.includes(bind.value);
      if (!has) {
        el.remove();
      }
    }
  })
}